#ifndef __TASK_H
#define __TASK_H

#include "stm32f4xx.h"

#define	REQ_DATA	1
#define ACK_DATA	2
#define MOTOR_DATA	3
#define LED_DATA	4


#define MAX_BUFF_LEN	256

extern uint8_t time_to_request;

void Task_Init();
int Task_Port_Write(uint8_t *data, uint32_t length);
int Task_Port_Read(uint8_t *data, uint32_t length);

void task_request(uint8_t pwr, uint8_t btn1, uint8_t btn2, uint8_t *e);
void send_task_ack();
void TaskPkt_Decode(uint8_t c);

#endif
